package com.plsjavaweb.core;

import java.util.List;

import org.apache.log4j.Logger;

import com.plsjavaweb.dao.DAOFactory;
import com.plsjavaweb.dao.interfaces.DAOFactoryInterface;
import com.plsjavaweb.logging.LoggingConstants;
import com.plsjavaweb.pojo.EmployeeSeatPOJO;

public class EmployeeSeatCore {
	static Logger log= Logger.getLogger(DAOFactory.class);
	static LoggingConstants logConst = new LoggingConstants();
	
	private DAOFactoryInterface daoService;
	
	public EmployeeSeatCore(){
		super();
		setDaoService(new DAOFactory());
	}
	//Get All Active Employees by Floor
	public List<EmployeeSeatPOJO> getEmployeeSeatsByBldgByFloor(String locationCode, String floor){
		log.info(LoggingConstants.entryMessage);
		//DAOFactory daoFactory = new DAOFactory();
		log.info(LoggingConstants.exitMessage);
		return daoService.getEmployeeSeatDAO().getEmployeeSeatsByBldgByFloor(locationCode, floor);
	}
	
	public List<EmployeeSeatPOJO> getEmployeesByProject(int projectID){
		log.info(LoggingConstants.entryMessage);
		DAOFactory daoFactory = new DAOFactory();
		
		log.info(LoggingConstants.exitMessage);
		return daoFactory.getEmployeeSeatDAO().getEmployeeSeatsByProject(projectID);
	}
	
	public DAOFactoryInterface getDaoService() {
		return daoService;
	}
	public void setDaoService(DAOFactoryInterface daoService) {
		this.daoService = daoService;
	}
}
